/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #5a67d8;
}

.error-message {
    color: #e53e3e;
    margin-top: 10px;
    text-align: center;
}

/* 主管理页面样式 */
.admin-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 通知提示样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.notification.success {
    background-color: #48bb78;
}

.notification.error {
    background-color: #f56565;
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-in;
}

/* 加载中提示样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-content p {
    color: #333;
    font-size: 16px;
}

/* 表单注意事项样式 */
.form-note {
    margin-top: 20px;
    padding: 12px 16px;
    background-color: #f7fafc;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.form-note p {
    margin-bottom: 8px;
    color: #4a5568;
}

.form-note ul {
    margin-left: 20px;
    color: #4a5568;
}

.form-note li {
    margin-bottom: 4px;
    font-size: 14px;
}

/* 动画效果 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 顶部导航 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 60px;
}

.header-left h1 {
    font-size: 20px;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#current-user {
    font-weight: 500;
}

.btn-logout {
    padding: 8px 16px;
    background-color: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.btn-logout:hover {
    background-color: #c53030;
}

.btn-change-password {
    padding: 8px 16px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-change-password:hover {
    background-color: #5a67d8;
}

/* 内容区域 */
.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background-color: #374151;
    color: white;
    padding: 20px 0;
}

.menu {
    list-style: none;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s;
}

.menu-item:hover {
    background-color: #4b5563;
}

.menu-item.active {
    background-color: #667eea;
}

/* 主内容 */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.view {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-header h2 {
    color: #333;
}

.btn-add {
    padding: 8px 16px;
    background-color: #48bb78;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-add:hover {
    background-color: #38a169;
}

/* 仪表盘卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid #667eea;
}

.card-icon {
    font-size: 28px;
    color: #667eea;
}

.card-title {
    color: #64748b;
    font-size: 14px;
}

.card-value {
    font-size: 24px;
    font-weight: bold;
    color: #334155;
}

/* 最近活动 */
.recent-activities {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 20px;
}

.recent-activities h3 {
    margin-bottom: 15px;
    color: #334155;
}

#activities-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    font-size: 14px;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 500;
    color: #334155;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* 表格图片样式 */
.table-image {
    width: 60px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
}

/* 操作按钮 */
.btn-group {
    display: flex;
    gap: 8px;
}

.btn-edit {
    padding: 5px 10px;
    background-color: #3182ce;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-edit:hover {
    background-color: #2c5aa0;
}

.btn-delete {
    padding: 5px 10px;
    background-color: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-delete:hover {
    background-color: #c53030;
}

.btn-view {
    padding: 5px 10px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-view:hover {
    background-color: #5a67d8;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-cancel {
    padding: 8px 16px;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel:hover {
    background-color: #4b5563;
}

.btn-submit {
    padding: 8px 16px;
    background-color: #48bb78;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: #38a169;
}

/* 表单样式 */
#modal-form .form-group {
    margin-bottom: 20px;
}

#modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

#modal-form input,
#modal-form textarea,
#modal-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#modal-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .menu {
        display: flex;
        overflow-x: auto;
    }
    
    .menu-item {
        white-space: nowrap;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}